package xdu.lz.stage2_design_pattern.chapter11_up_down_context_pattern;


public class QueryFromDBAction {

    //Context 是POJO
    public void execute(){
        try {
            Thread.sleep(100);
            //simulation from db
            String name = "zs" + Thread.currentThread().getName();
            //ActionContext.getActionContext()拿到的是当前线程绑定的唯一Context对象
            ActionContext.getActionContext().getContext().setName(name);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
